<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/conn.asp"-->
<!--#include file="lib/saferequest.asp"-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="lib/jquery_mobile_lastest/jquery_mobile_lastest.css" />
<script type="text/javascript" src="lib/jquery_lastest.js"></script>
<script src="lib/jquery_mobile_lastest/jquery_mobile_lastest.js"></script>
<!-- <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&language=zh-CN"></script> -->
<script type="text/javascript">
	function detectBrowser() {
		var useragent = navigator.userAgent;
		var mapdiv = document.getElementById("res");
			
		if (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1 ) {
			mapdiv.style.width = '100%';
			mapdiv.style.height = '100%';
		} else {
			//mapdiv.style.width = '480px';
			//mapdiv.style.height = '800px';
		}
	}
	
	$(function() {
		detectBrowser();
		$("#accept_all").click(function(){
			
		
		});
	});
	
	
</script>

</head>
<%
	clid=saferequest("clid",1)
	o=saferequest("o",0)
	if o="all" then sql="update progress set progress_accept=now() where isnull(progress_accept) and progress_cl="&clid
	if o<>"" then
		set cmd=server.CreateObject ("adodb.command")
		set cmd.ActiveConnection =conn
		cmd.CommandText =sql
		cmd.Execute
		
	end if
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql="select cph,clm from cl where clid="&clid
	rs.open sql,conn,1,1
%>
<body>
<div id="res" data-role="page" >

	<div data-role="header">
		<a href="deal.asp?clid=<%=clid%>" data-role="button" data-icon="refresh" class="ui-btn-left" rel="external">刷新</a>
		<h1><%=rs("cph")%> 的货单</h1>
		<a id="accept_all" href="deal.asp?clid=<%=clid%>&o=all" data-role="button" data-icon="check" class="ui-btn-right" rel="external">全接</a>
	</div>

	<div data-role="content" style="padding: 0;">	
		<ul data-role="listview"  data-splittheme="d" style="margin: 0;">
<%
	rs.close
	sql="select id,sj,rq,dd,xx,tx,hx,customer_name,attentions,progress_accept from ((select * from progress where progress_done=false and progress_cl="&clid&" and not isnull(progress_accept)) as p inner join yb on p.progress_yb=yb.id) left join customer on yb.yb_customer=customer.customer_id order by progress_accept desc"
	rs.open sql,conn,1,1
%>
			<li data-role="list-divider">已接受<span class="ui-li-count"><%=rs.RecordCount%></span></li> 
<%
	do while not rs.eof
%>
			<li>
				<h3>
					<a href="deal_info.asp?ybid=<%=rs("id")%>" rel="external">
						<table width="100%" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td><%=rs("customer_name")%></td>
									<td align="right"><%=FormatDateTime(rs("sj"),4)%></td>
								</tr>
							</tbody>
						</table>
					</a>
				</h3>
				<table width="100%" cellpadding="0" cellspacing="0" style="font-size: 14px; font-weight: normal; margin: -0.5em 0 0.6em;">
					<tbody>
						<tr>
							<td><%=rs("dd")%>&nbsp;<%=rs("xx")%>柜</td>
							<td align="right"><%=ShortDate(rs("rq"))%></td>
						</tr>
					</tbody>
				</table>
				<p style="font-size:14px">提：<%=rs("tx")%>&nbsp;还：<%=rs("hx")%></p>
				<p style="font-size:14px;font-weight:bold;color:red;white-space:normal;"><%=rs("attentions")%></p>
				<a href="deal_info.asp?ybid=<%=rs("id")%>" <%if rs("progress_accept")<>"" then response.write("data-icon='check'")%> rel="external"><%=rs("customer_name")%></a>
			</li>
<%
		rs.movenext
	loop
	rs.close
%>

<%
	
	sql="select id,sj,rq,dd,xx,tx,hx,customer_name,attentions,progress_accept from ((select * from progress where progress_done=false and progress_cl="&clid&" and isnull(progress_accept)) as p inner join yb on p.progress_yb=yb.id) left join customer on yb.yb_customer=customer.customer_id order by progress_start desc"
	rs.open sql,conn,1,1
%>
			<li data-role="list-divider">待处理<span class="ui-li-count"><%=rs.RecordCount%></span></li> 
<%
	do while not rs.eof
%>
			<li>
				<h3>
					<a href="deal_info.asp?ybid=<%=rs("id")%>" rel="external">
						<table width="100%" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td><%=rs("customer_name")%></td>
									<td align="right"><%=FormatDateTime(rs("sj"),4)%></td>
								</tr>
							</tbody>
						</table>
					</a>
				</h3>
				<table width="100%" cellpadding="0" cellspacing="0" style="font-size: 14px; font-weight: normal; margin: -0.5em 0 0.6em;">
					<tbody>
						<tr>
							<td><%=rs("dd")%>&nbsp;<%=rs("xx")%>柜</td>
							<td align="right"><%=ShortDate(rs("rq"))%></td>
						</tr>
					</tbody>
				</table>
				<p style="font-size:14px">提：<%=rs("tx")%>&nbsp;还：<%=rs("hx")%></p>
				<p style="font-size:14px;font-weight:bold;color:red;white-space:normal;"><%=rs("attentions")%></p>
				<a href="deal_info.asp?ybid=<%=rs("id")%>" <%if rs("progress_accept")<>"" then response.write("data-icon='check'")%> rel="external"><%=rs("customer_name")%></a>
			</li>
<%
		rs.movenext
	loop

%>
		</ul>
	</div><!-- /content -->
</div>
</body>
<%
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>
</html>
